<!--
 * @Author: “2Hq1” 274895084@qq.com
 * @Date: 2024-11-11 13:39:24
 * @LastEditors: “2Hq1” 274895084@qq.com
 * @LastEditTime: 2024-11-27 15:25:18
 * @FilePath: \test_1\one.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <meta
            name="viewport"
            content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
    />
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="demic">
    {{ count }}<br/>
    <input @keyup.enter="lpo"/><br/>
    <button @click="add">加法</button>
    <button @click="beam">触发</button>

    <span>{{ name }}</span>
</div>

<script>
    const app = new Vue({
        el: "#demic",
        data() {
            return {
                count: 6,
                name: "",
                sping: "",
            };
        },
        methods: {
            lpo() {
                console.log("1314");
            },
            add() {
                this.count++;
            },
            beam() {
                alert(this.sping)
            }
        },
        mounted() {
            axios
                .get("http://127.0.0.1:8080/hello")
                .then((result) => {
                    this.sping = result.data.name;
                });

        },
    });
</script>
</body>
</html>
